* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 3 Aug 2009 08:21:29 +0000 (08:21 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 3 Aug 2009 08:21:29 +0000 (08:21 +0000)
defconst.
(tramp-rfn-eshadow-update-overlay): Use it.

lisp/net/tramp.el

index e8ce36e4c07245bb17ec8a614c548ca1217f7607..df2f10ba5dd5f2254199b2450c7fc6ed4d7d84ec 100644 (file)
@@ -2196,6 +2196,9 @@ special handling of `substitute-in-file-name'."
               (remove-hook 'rfn-eshadow-setup-minibuffer-hook
                            'tramp-rfn-eshadow-setup-minibuffer))))
 
+(defconst tramp-rfn-eshadow-update-overlay-regexp
+  (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
+
 (defun tramp-rfn-eshadow-update-overlay ()
   "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input.
 This is intended to be used as a minibuffer `post-command-hook' for
@@ -2209,7 +2212,10 @@ been set up by `rfn-eshadow-setup-minibuffer'."
       (save-excursion
        (save-restriction
          (narrow-to-region
-          (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
+          (1+ (or (string-match
+                   tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end)
+                  end))
+          (point-max))
          (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
                (rfn-eshadow-update-overlay-hook nil))
            (move-overlay rfn-eshadow-overlay (point-max) (point-max))